#include "gtest/gtest.h"
#include "Color.h"

USING_NS_B2D

TEST(test_color, test_int32_conversion)
{
	Color red_4f(1,0,0,1);

	char individual[4] = {0xFF, 0, 0, 0xFF};
	
	auto expected = *reinterpret_cast<const b2d::uint32*>(&individual);
	auto actual = red_4f.getRGBA();

	EXPECT_EQ(expected, actual);
}

TEST(test_color, test_comparasion)
{
	Color myred(1,0,0,1);
	Color red = Color::Red;
	Color blue = Color::Blue;

	bool red_eq_myred = (red == myred);
	bool red_neq_myred = (red != myred);
	bool red_eq_blue = (red == blue);
	bool red_neq_blue = (red != blue);

	EXPECT_EQ(true, red_eq_myred);
	EXPECT_EQ(false, red_neq_myred);
	EXPECT_EQ(false, red_eq_blue);
	EXPECT_EQ(true, red_neq_blue);
}